<template>
	<view class="main">
		<u-navbar title="工单列表" :bgColor="bgColor"></u-navbar>

		<view>
			<view style="height: 5px;"></view>
			<view style="margin: 5px;">
				<yt-order-list :orderList="orderList" @Transfer="Transfer" @jieOrder="jieOrder"
					@callUser="callUser"></yt-order-list>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				bgColor: '#0081ff',
				orderList: [{
						orderId: '202404160001',
						title: '测试点位名称01',
						status: 3, //3:已完成 2:进行中 否则待接单
						cate: '主干扩容',
						name: '张师傅',
						time: '2024-4-16 18:00',
						km: '0.6km',
						mobile: '18638888888'
					},
					{
						orderId: '202404160002',
						title: '测试点位名称02',
						status: 1,
						cate: '分光器扩容',
						name: '李师傅',
						time: '2024-4-16 17:00',
						km: '0.6km',
						mobile: '18638888889'

					}
				],
			}
		},
		methods: {
			/**
			 * @method Transfer
			 * 订单转派
			 * @param {Object} id
			 */
			Transfer(e) {
				uni.navigateTo({
					url: '/pages/kwork/detail?status=' + e.status
				})
			},
			/**
			 * @method jieOrder
			 * 接单
			 * @param {Object} id
			 */
			jieOrder(id) {
				console.log("接单", id);
			},
			/**
			 * @method callUser
			 * 联系
			 * @param {Object} id
			 */
			callUser(id) {
				console.log("联系", id);
			}
		}
	}
</script>
<style lang="scss">
	// .main{
	// 	margin: 5px;
	// }
</style>